
<%@ page import="com.diseaseInformation.Disease" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'disease.label', default: 'Disease')}" />
  <title>${fieldValue(bean: diseasentInstance, field: "name")+"["+entityName+"]"}</title>

  <g:javascript library="prototype" />
    </head>
    <body>


    <g:javascript>
    function getSelText()
    {
    var txt = '';
    if (window.getSelection)
    {
    txt = window.getSelection();
    }
    else if (document.getSelection)
    {
    txt = document.getSelection();
    }
    else if (document.selection)
    {
    txt = document.selection.createRange().text;
    }
    else return;
    return  txt;
    }
    
    function tooltipPopup(e){
      var tooltip = document.getElementById('tooltip')
      //var key = getSelText()
      tooltip.innerHTML = e.responseText
      if(tooltip.innerHTML.length>0){
      tooltip.style.visibility='visible'
      }else{
      tooltip.style.visibility='hidden'
      }
    }
    
    function over(type,data){
      ${remoteFunction(controller:"engineinformation", action:"getdata", params:"'id=' + data+'&type=' + type", onComplete:"updateover(e)")}
    }
    function updateover(e){
       var model = eval("(" + e.responseText + ")") // evaluate JSON
       var tooltip = document.getElementById('tooltip')
       
      tooltip.innerHTML = model.data      //set data to tooltip
      
      if(tooltip.innerHTML.length>0){     //set Visible
      tooltip.style.visibility='visible'
      }else{
      tooltip.style.visibility='hidden'
      }
    }
    </g:javascript>


        <div class="nav">
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1>${fieldValue(bean: diseaseInstance, field: "name")+"["+entityName+"]"}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog">
                <table>
                    <tbody>
                                      
                        <tr class="prop">       
                            <td valign="top" class="value" onclick="${remoteFunction(controller:'engineinformation',action:'tooltip',onComplete:'tooltipPopup(e)',params:'\'value=\' + getSelText()')}">${diseaseInstance?.data}</td>
                        </tr>
                    
                        <tr class="prop">                           
                            <td valign="top" class="value"><b>Last Update</b> :${diseaseInstance?.lastUpdated?.encodeAsHTML()}</td>
                            <td valign="top" class="value"><b>Viewer</b> :${diseaseInstance?.viewer?.encodeAsHTML()}</td>
                        </tr>
                        <tr class="prop">                           
                            <td valign="top" class="value"><b:bookmark title="${diseaseInstance?.name}" permalink="${ipAddressUrl}/telemedicine/disease/show/${diseaseInstance?.id}" type="addtoany"/></td>
                        </tr>
                    
                    </tbody>
                </table>
        <g:render template="/layouts/tooltip" />
        <!--div id="tooltip" class="tooltip" readonly="readonly"><b>ddd</b></div-->
            </div>
            <div class="buttons">
                <g:form>
                    <g:hiddenField name="id" value="${diseaseInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </g:form>
            </div>
        </div>     
    </body>
</html>
